package com.redsamurai.view.beans;


import javax.faces.event.ActionEvent;

import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.nav.RichCommandMenuItem;


public class Employees {
    private RichTable emplsTable;

    public Employees() {
        super();
    }

    public void switchTableMode(ActionEvent actionEvent) {
        RichCommandMenuItem menuItem = (RichCommandMenuItem)actionEvent.getComponent();
        
        boolean selected = menuItem.isSelected();
        this.getEmplsTable().setScrollPolicy(selected ? "scroll" : "page");
    }

    public void setEmplsTable(RichTable emplsTable) {
        this.emplsTable = emplsTable;
    }

    public RichTable getEmplsTable() {
        return emplsTable;
    }
    
    public boolean isTableScrollMode() {
        return ("scroll".equals(this.getEmplsTable().getScrollPolicy()) ? true : false);
    }
}
